## Loading tidyverse: ggplot2
## Loading tidyverse: tibble
## Loading tidyverse: tidyr
## Loading tidyverse: readr
## Loading tidyverse: purrr
## Loading tidyverse: dplyr
## Conflicts with tidy packages ----------------------------------------------
## filter(): dplyr, stats
## lag():    dplyr, stats
## Loading required package: methods

What does it mean to sample from a distribution?

Updating beliefs

Quantifying uncertainty

  • We have two categories /b/ and /p/.
  • Realized as normal distributions on an acoustic cue \[ p(\mathrm{VOT} | \mu, \sigma^2) \]
  • We don’t know the mean \(\mu\) and variance \(\sigma^2\).
  • Express our uncertainty as a probability distribution over the mean and variance: \[p(\mu, \sigma^2)\]
  • This distribution assigns a degree of belief for each particular combination of mean \(\mu\) and variance \(\sigma^2\).

Learning from experience

  • How do we update our beliefs based on experience?
  • Conceptually, Bayes Rule: \[ p(\mu, \sigma^2 | x) \propto p(\mathrm{VOT}=x | \mu, \sigma^2) p(\mu, \sigma^2) \]

How??

Why, god

How???

Why, god.

How????

Why, god..

Enough

  • Working with the distribution directly is hard.
  • Neither researchers nor brains want to do a lot of algebra.
  • What if there was a better way?!
  • Replace continuous distribution \(p(\mu, \sigma^2)\) with samples of plausible hypotheses.
  • Re-weight samples based on how well they predict the data

One sample of prior \(p(\mu,\sigma^2)\)

Many samples approximate \(p(\mu,\sigma^2)\)

Many samples approximate \(p(\mu,\sigma^2)\)

Many samples approximate \(p(\mu,\sigma^2)\)

Weighting samples by importance

  • How do you update samples to reflect new information?
  • Notation: for each category, there are \(K\) samples of \((\mu_k, \sigma^2_k)\), where \(k = 1 \ldots K\).
  • Samples are all equally representative of prior, so have the same initial weight: \(w^k_0 = 1/K\).
  • Re-weight samples based on likelihood of data given that sample (how well hypothesis predicts data): \[ w^k_n = w^k_0 p(x_1, \ldots, x_n | \mu_k, \sigma^2_k) \]